//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.example.demo.component;

import org.springframework.cache.Cache;
import org.springframework.cache.Cache.ValueWrapper;
import org.springframework.cache.CacheManager;

public class SessionHelper {
    public static final String sessionCacheName = "sessionCache";
    static CacheManager cacheManager = (CacheManager)SpringContextHolder.getBean("sessionManager");
    static Cache cache;

    public SessionHelper() {
    }

    public static void put(String key, Object value) {
        cache.put(key, value);
    }

    public static Object get(String key) {
        ValueWrapper value = cache.get(key);
        return value != null ? value.get() : null;
    }

    public static Object getAndNotUpdateExpires(String key) {
//        ValueWrapper value = ((MpCache)cache).get(key, false);
        ValueWrapper value = null;
        return value != null ? value.get() : null;
    }

    public static void remove(String key) {
        cache.evict(key);
    }

    public static boolean removeAll() {
        cache.clear();
        return true;
    }

    public static int getPlatformType() {
        return 1;
    }

    public static Cache getCache() {
        return cache;
    }

    static {
        cache = cacheManager.getCache("sessionCache");
    }
}
